<template>
	<div class="container">
		<!-- 主导航栏 -->
		<ul class="main-tabs clearfix">
			<li v-for="(item,index) in mainTabs.data" :key="index" :class="{active:index==mainTabs.index}"
				@click="mainTabSwitch(index)">{{item.title}}</li>
		</ul>
		<!-- 头部信息 -->

		<h3 class="header-title clearfix">
			<span class="border"></span>
			<p>{{headerTitle}}</p>
			<div class="opt fr clearfix" v-if="mainTabs.index == 2 && navList.index == 5">
				<span class="upload-btn" @click="leadMsg.showDialog = true">导入表格发放返费</span>
			</div>
			<div class="opt fr clearfix" v-if="mainTabs.index == 3 && navList.index == 0">
				<span class="upload-btn" @click="reset()">刷新</span>
				<span class="upload-btn" @click="openAddPositionDialog('add')">添加岗位</span>
			</div>

		</h3>
		<div v-if="mainTabs.index == 3 && navList.index == 1">
			<el-input v-model="searchName" placeholder="请输入企业或岗位名称" style="width: 15%;"></el-input>
			<el-button style="background-color: #0064E4; color: white;" @click="getPayList()">搜索</el-button>
		</div>

		<div v-if="mainTabs.index == 4 && navList.index == 0">
			<el-input v-model="searchName1" placeholder="请输入企业或岗位名称" style="width: 15%;"></el-input>
			<el-button style="background-color: #0064E4; color: white;" @click="getStoreRecruitmentList()">搜索
			</el-button>
		</div>

		<div v-if="mainTabs.index == 4 && navList.index == 1">
			<el-input v-model="searchName1" placeholder="请输入企业或岗位名称" style="width: 15%;"></el-input>
			<el-button style="background-color: #0064E4; color: white;" @click="getStoreRecruitmentList()">搜索
			</el-button>
		</div>

		<div v-if="mainTabs.index == 4 && navList.index == 2">
			<el-input v-model="searchName1" placeholder="请输入企业或岗位名称" style="width: 15%;"></el-input>
			<el-button style="background-color: #0064E4; color: white;" @click="getStoreRecruitmentList()">搜索
			</el-button>
		</div>
		<p v-if="mainTabs.index == 2">
			关键字：<el-input v-model="searchData.keyval" style="display: inline-block; width: 240px;"
				placeholder="请输入门店或岗位名称查询"></el-input>
			<el-button style="background-color: #0064E4; color: white;" @click="getRefundList()">搜索</el-button>
		</p>
		<div v-if="mainTabs.index == 5 && navList.index == 0">

			<!-- 专享岗位：<el-input v-model="signsearchName" @focus="openPositioname()" placeholder="请输入专享岗位名称"
				style="width: 15%;"></el-input> -->

			岗位/门店名称：<el-input v-model="storshopname" placeholder="请输入门店/岗位名称" style="width: 15%;"></el-input>
			报名人员状态：
			<el-cascader v-model="signtypelist" placeholder="请选择状态" :options="statusoptions" @change="casechange">
			</el-cascader>

			<el-button style="background-color: #0064E4; color: white;" @click="getStoreApply()">搜索</el-button>
		</div>
		<!-- 简历弹框 -->
		<el-dialog :visible.sync="dialogVisible" width="1040px">
			<resume-detail v-if="dialogVisible" :userid="userid" :nickName="nickName" :isShowTelphone="true">
			</resume-detail>
		</el-dialog>
		<!-- 备注弹框 -->
		<el-dialog :visible.sync="showremark" :before-close="handleClose" width="480px" class="evalDialog">
			<div class="remark">
				<h3>备注</h3>
				<el-input type="textarea" v-model="remarkvalue" placeholder="请输入备注" :rows="4"></el-input>
				<el-button type="primary" @click="subremark">确定</el-button>
			</div>
		</el-dialog>


		<!-- 返费弹框 -->
		<el-dialog :visible.sync="refundshowDialog" :before-close="handleClose" width="480px" height='220px'
			class="evalDialog">
			<div class="box_entry" v-show="contentshow">
				<h2>发放奖励</h2>
				<div class="item" @click="changereturnval('专项岗位入职奖励（入职人员）')">专项岗位入职奖励（入职人员）</div>
				<div class="item" @click="changereturnval('专项岗位招聘奖励（门店创建者）')" style="margin-bottom: 20px;">
					专项岗位招聘奖励（门店创建者）</div>
			</div>

			<div class="box_content" v-show="!contentshow">
				<h2>{{returntitle}}</h2>
				<el-form ref="form" :model="returnform" medium label-width="120px" style="padding-left: 38px;">
					<el-form-item :label="peoplename" style="font-size: 18px;">
						<span style="font-size: 18px;">{{dialogusername}}</span>
					</el-form-item>
					<div style="padding-top: 6px;
    margin-bottom: 10px;">
						<el-form-item label="奖励金额:">
							<el-input v-model="returnform.price" style="width: 80%;" placeholder="请输入奖励金额"></el-input>
						</el-form-item>
					</div>

					<div style="margin-bottom: 10px;">
						<el-form-item label="管理员手机号:" label-width="125px">
							<span style="font-size: 16px;">15202120781 </span> <span class="getcode">
								<span v-if="show" @click.stop="getcodes()">
									获取验证码
								</span>
								<span v-show="!show" class="count">已发送{{count}} s</span>
							</span>
						</el-form-item>
					</div>
					<el-form-item label="验证码:">
						<el-input v-model="returnform.code" @blur="checkcode" style="width: 80%;" placeholder="请输入验证码">
						</el-input>
					</el-form-item>
					<el-button type="primary" class="subtn" v-preventReClick @click="givepoint">确认发放</el-button>
				</el-form>
			</div>

		</el-dialog>





		<!-- 搜索栏 -->
		<comSearch v-if="searchData.showComponent" :options="searchData" @search="searchList"
			v-show="mainTabs.index!=2"></comSearch>
		<!-- 副导航栏 -->
		<comNavTabs :navList="navList" @switch="tabSwitch"></comNavTabs>


		<!-- 数据展示的列表 -->
		<comTable :options="tableList" @openRefundDialog="openRefundDialog"
			@openreturn="function(data){openExamineDialog('lookreturnshop',data)}"
			@openExamineDialog="function(data){openExamineDialog('examine',data)}"
			@openLookDialog="function(data){openExamineDialog('look',data)} "
			@editLookDialog="function(data){ediExamineDialog('edit',data)} " @openPayDialog="openPayDialog"
			@getsignname="function(data){getsignname('reshelf',data)}"
			@getshopinfo="function(data){openExamineDialog('lookshop',data)}" @offTheShelf="offTheShelf"
			@addremark="function(data){addremark(data)}" @addremarks="function(data){addremark(data,'return')}"
			@totop="function(data){totop(data)}" @position="positionDetails"
			@reshelf="function(data){openAddPositionDialog('reshelf',data)}"
			@updateTheShelf="function(data){openAddPositionDialog('updateTheShelf',data)}" @examinePosit="examinePosit"
			@passed="function(data){passed(data)}" @unpassed="function(data){unpassed(data)}"
			@unpass="function(data){unpass(data)}" @postOffShelves="postOffShelves" @postView="postView"></comTable>

		<!-- @updateTheShelf="updateTheShelf" -->
		<!-- 门店信息审核弹窗 -->
		<storeExamineDialog :options="storeMsg" @examineStore="examineStoreFn"></storeExamineDialog>

		<storeExamineEditDialog :options="storeMsg" @examineStore="examineStoreFn"></storeExamineEditDialog>


		<!-- 门店审核通过弹窗 -->
		<storePassExamine :options="passExamine" @passStore="passStore"></storePassExamine>
		<!-- 已发放返费弹窗 -->
		<storeRefundDialog :options="refund"></storeRefundDialog>
		<!-- 发放返费弹窗 -->
		<storePayDialog :options="pay" @subPayData="subPayData"></storePayDialog>
		<!-- 新增岗位弹窗 -->
		<storeAddPostDialog :options="postMsg" @closeDialog="closePostDialogn"></storeAddPostDialog>
		<!-- 搜索岗位名字 -->
		<storeAddPostDialogByName :options="postMsgByname" @handleChange="changeName" @closeDialog="closePostDialogn">
		</storeAddPostDialogByName>
		<!-- 一键导入数据弹窗 -->
		<storeImportDataDialog :options="leadMsg" @openImportResult="openImportResult"></storeImportDataDialog>
		<!-- excel导入结果模板 -->
		<storeImportResultDialog :options="importData" @subImportData="subImportData"></storeImportResultDialog>
		<!-- 下架岗位信息弹窗 -->
		<storePutDownPosition ref="postReason" :options="putDownPosition" @subPutDown="subPutDown">
		</storePutDownPosition>
		<!-- 岗位信息弹窗 -->
		<comRecruitPosition :options="positionMsg"></comRecruitPosition>
		<!-- 门店岗位招聘-下架岗位查看 -->
		<comPutDownRecord :options="putDownRecordMsg"></comPutDownRecord>

		<!-- 分页器 -->
		<div class="pageBox">
			<el-pagination @size-change="handleSizeChange" @current-change="pageChange" :current-page.sync="cur"
				:page-sizes="[10, 20, 30, 50, 100]" :page-size="pageSize"
				layout="total, sizes, prev, pager, next, jumper" :total="totalNum" background></el-pagination>
		</div>


	</div>
</template>
<script>
	export default {
		components: {
			comNavTabs: () => import("@/household/common/comNavTabs.vue"),
			comSearch: () => import("@/component/common/comSearch.vue"),
			comRecruitPosition: () => import("@/component/common/comRecruitPosition.vue"),
			comPutDownRecord: () => import("@/component/common/comPutDownRecord.vue"),
			comTable: () => import("@/household/common/comTable.vue"),
			storeExamineDialog: () => import("@/component/pages/storeExamineDialog.vue"),
			storeExamineEditDialog: () => import("@/component/pages/storeExamineEditDialog.vue"),
			storePassExamine: () => import("@/component/pages/storePassExamine.vue"),
			storeRefundDialog: () => import("@/component/pages/storeRefundDialog.vue"),
			storePayDialog: () => import("@/component/pages/storePayDialog.vue"),
			//添加岗位
			storeAddPostDialog: () => import("@/component/pages/storeAddPostDialog.vue"),
			// 根据列表查询名字
			storeAddPostDialogByName: () => import("@/component/pages/storeAddPostDialogByName.vue"),
			storeImportDataDialog: () => import("@/component/pages/storeImportDataDialog.vue"),
			storeImportResultDialog: () => import("@/component/pages/storeImportResultDialog.vue"),
			storePutDownPosition: () => import("@/component/pages/storePutDownPosition.vue"),
			resumeDetail: () => import("@/component/resumeDetail/index.vue"),
		},
		data() {
			return {
				peoplename: '',
				istop: 1,
				dialogusername: '',
				index3: "",
				contentshow: true,
				count: 0,
				show: true,
				timer: null,
				returntitle: '标题',
				refundshowDialog: false,
				// testdata: [{
				// 		shopName: '线下门店一号',
				// 		username: '小白',
				// 		nextusername: '小黑',
				// 		positionname: '打螺丝',
				// 		entrydate: '2021-2-2',
				// 	},
				// 	{
				// 		shopName: '线下门店二号',
				// 		username: '小白',
				// 		nextusername: '小黑',
				// 		positionname: '打螺丝',
				// 		entrydate: '2021-2-2',
				// 	},
				// 	{
				// 		shopName: '线下门店三号',
				// 		username: '小白',
				// 		nextusername: '小黑',
				// 		positionname: '打螺丝',
				// 		entrydate: '2021-2-2',
				// 	}


				// ],
				signtypelist: [],
				statusoptions: [{
						value: '1',
						label: '待办',
						children: [{
								value: '1',
								label: '待沟通'
							}, {
								value: '2',
								label: '未回复'
							}, {
								value: '3',
								label: '回复同意'
							},
							{
								value: '4',
								label: '回复拒绝'
							},
						]
					},
					{
						value: '2',
						label: '录取',
						children: [{
								value: '1',
								label: '工作中'
							}, {
								value: '2',
								label: '保障期待确认'
							}, {
								value: '3',
								label: '保障期确认完成'
							},
							{
								value: '4',
								label: '线下门店发起离职'
							},
							{
								value: '5',
								label: '报名人员确认离职'
							}
						]
					}, {
						value: '3',
						label: '未录取',
						children: null
					},
					{
						value: '4',
						label: '无意愿',
						children: null
					},

				],
				addmarkdata: {},
				remarkvalue: '',
				showremark: false,
				returntypes: false,
				Action: '',
				dialogVisible: false,
				signtype: '', //报名人员状态
				communicationtype: '',
				storshopname: '', //门店名称
				signsearchName: '', //专享岗位名称
				optionss: [],
				searchName: '',
				searchName1: '',
				updatedata: '',
				/* 主导航栏列表数据 */
				mainTabs: {
					index: 0, //当前是在哪个tab栏
					data: [{
							title: '门店列表'
						},
						{
							title: '门店信息审核'
						},
						{
							title: '返费管理'
						},
						{
							title: '公告岗位管理'
						},
						{
							title: '门店招聘岗位管理'
						},
						{
							title: '报名人员'
						},
					]
				},
				headerTitle: '门店列表', //头部标题

				/* 副导航栏列表数据 */
				navList: {
					index: 0, //当前是在哪个tab栏
					data: [
						/* {title:'待审核'},
						{title:'已通过'},
						{title:'未通过'} */
					]
				},
				checkcodes: false,
				returnform: {
					code: '',
					price: '',
				},
				/* 搜索栏数据 */
				searchData: {
					showComponent: true, //显示
					noCompanyName: false, //企业名称
					noShopName: true, //门店名称
					noFounder: true, //创建者姓名
					noTime: true, //时间段
					noSubordinate: false, //下级入职人员姓名
					noPost: false, //下级入职公告岗位
					keyval: '',
					searchInfo: {}, //搜索信息
				},
				/* 表格数据 */
				tableList: {
					list: [{
							title: '门店编号',
							prop: 'shopName',
							isClick: false
						},
						{
							title: '门店名称',
							prop: 'shopName',
							isClick: false
						},
						{
							title: '创建者姓名',
							prop: 'createusername',
							isClick: false
						},
						{
							title: '注册时间',
							prop: 'insertdate',
							isClick: false
						},
					],
					noOperation: false, //是否有操作项
					operation: [ //操作项内容
						{
							name: '操作',
							isBtn: false,
							title: 'openFlexDialog'
						}
					],
					data: [
						/* {
							shopName: '上海天都人力资源有限公司',			//门店名称
							createusername: '张三',						//创建者姓名
							nsertdate: '2020-10-12',					//注册时间
						} */
					]
				},
				redata: {},
				/* 门店信息弹窗数据 */
				storeMsg: {
					fileLists: [],
					showEditDialog: false,
					showDialog: false, //显示
					type: '', //打开弹窗的类型
					msg: { //门店信息
						shopName: '', //门店名称
						area: '', //门店地址
						detilAddress: '', //详细地址
						operationContact: '', //门店联系人
						operationContactNumber: '', //门店联系电话
						storePhotos: '', //门店照片
						storeBusinessLicense: '', //门店营业执照

					},
					dataList: [], //审核记录
				},
				/* 门店审核通过弹窗 */
				passExamine: {
					showDialog: false, //显示
					userInfo: {}, //信息
				},
				/* 返费弹窗数据 */
				refund: {
					showDialog: false, //显示
					data: { //返费信息
						shopName: '', //门店名称
						refundStandard: '', //返费标准
						nextusername: '', //下级入职人员姓名
						telnum: '', //手机号码
						positionname: '', //下级入职公告岗位
						companyname: '', //企业名称
						interalnum: '', //返费金额

					}
				},
				/* 发放返费弹窗数据 */
				pay: {
					showDialog: false, //显示
					data: { //发放返费信息
						shopName: '', //门店名称
						nextusername: '', //下级入职人员姓名
						telnum: '', //手机号码
						positionname: '', //下级入职公告岗位
						companyname: '', //企业名称
						entrydate: '', //入职日期
						interalnum: '', //返费	
					},
					eventName: 'subPayData',
				},
				/* 岗位信息 */
				postMsg: {
					showDialog: false, //显示
					type: '', //类型，新增还是重新上架
					userInfo: {}, //当前栏信息
				},
				postMsgByname: {
					showDialog: false, //显示
					type: '', //类型，新增还是重新上架
					userInfo: {}, //当前栏信息
				},
				/* 一键导入弹窗显示数据 */
				leadMsg: {
					showDialog: false, //显示

				},
				/* 导入结果显示数据 */
				importData: {
					showDialog: false, //显示
					dataList: [], //导入数据结果
				},
				/* 下架岗位信息 */
				putDownPosition: {
					showDialog: false, //显示
					userInfo: {}, //下架信息
				},
				/* 岗位信息弹窗 */
				positionMsg: {
					showDialog: false, //显示
					company: '', //公司名称
					userInfo: {}, //
				},
				/* 下架记录数据 */
				putDownRecordMsg: {
					showDialog: false, //显示
					tableData: [], //表格数据
				},


				/* 分页功能数据 */
				cur: 1,
				pageSize: 10,
				totalNum: 0, //总共有多少条数据,根据这个数据去适配页数 
				appliocationid: '',
				diauserid: '',
				otype: '',

			}
		},
		created() {
			this.mainTabSwitch(0);
		},
		mounted() {
			this.Action = this.mainTabs.index
		},
		watch: {
			Actions(val) {
				this.Action = val
				console.log(val, 1111111111);
				if (this.Action == "5") {
					setTimeout(() => {
						this.getStoreApply();
					}, 3000)
					console.log("监听");

				}
			},
		},

		mounted() {
			this.Action = this.mainTabs.index
		},
		methods: {
			//置顶
			totop(data) {
				if (data.istop == 0) {
					this.istop = 1
				} else {
					this.istop = 0
				}
				let dats = {
					applicationid: data.applicationid,
					istop: this.istop
				}
				this.$ceshiGetAxios('/v1/shop/updateistop', dats).then(res => {
					if (res.data.code == 1) {
						this.$message.success('操作成功')
						this.mainTabSwitch(this.mainTabs.index)

					} else {
						this.$message.warning(res.data.message)
					}
				})

			},
			//发放积分
			givepoint() {
				if (this.checkcodes) {
					let params = {
						appliocationid: this.appliocationid, //报名表id
						userid: this.diauserid, //用户id
						operation: this.otype, //操作类型1--入职奖励 2--招聘奖励
						integral: this.returnform.price //积分
					}
					this.$ceshiAxios.post('/v1/shop/DistributionIntegral', params).then(res => {
						console.log(res);
						if (res.data.code == 1) {
							this.$message.success('发放成功')
							this.refundshowDialog = false
							this.returnform = {}
							this.show = true
							this.mainTabSwitch(this.mainTabs.index)
						} else {
							this.$message.success(res.data.message)
						}
					})

				}
			},


			//验证验证码
			checkcode() {
				if (this.returnform.code != '') {
					let params = {
						telnum: 15202120781,
						code: this.returnform.code,
					}
					this.$ceshiAxios1.post('/v1/user/CodeVerify', params).then(res => {
						console.log(res);
						if (res.data.code == 1) {
							this.checkcodes = true
						} else {
							this.$message.warning(res.data.message)
						}
					})
				} else {
					this.$message.warning('请输入验证码')
				}
			},

			getcodes() {
				const TIME_COUNT = 60;
				if (!this.timer) {
					this.count = TIME_COUNT;
					this.show = false;
					this.timer = setInterval(() => {
						if (this.count > 0 && this.count <= TIME_COUNT) {
							this.count--;
						} else {
							this.show = true;
							clearInterval(this.timer);
							this.timer = null;
						}
					}, 1000)
				}
				let codestr = 15202120781 + "/" + "@$%&12#3$#@"
				let md5code = this.$md5(codestr)
				console.log(md5code);
				let params = {
					telnum: 15202120781,
					encryptCode: md5code
				}
				this.$ceshiAxios1.post('v1/user/sendMsgCode', params).then(res => {
					console.log(res);
					if (res.data.code == 1) {
						this.$message.success('发送成功')
						this.refundshowDialog = true
					} else {
						this.$message.warning(res.data.message)
					}
				})


			},



			changereturnval(val) {
				if (val == '专项岗位入职奖励（入职人员）') {
					this.otype = 1
					this.peoplename = '入职人员:'

				} else {
					this.peoplename = '门店创建者:'
					this.otype = 2
				}

				if (this.otype == '1') {
					this.dialogusername = this.redata.username;
					this.diauserid = this.redata.userid;
				} else if (this.otype == '2') {
					this.dialogusername = this.redata.shopusername;
					this.diauserid = this.redata.shopuserid;
					console.log('222222222222222');
				}


				this.contentshow = false
				this.returntitle = val
			},
			casechange() {
				this.signtype = this.signtypelist[0]
				this.communicationtype = this.signtypelist[1]
				this.getStoreApply();
				console.log(this.signtypelist);
				// console.log(this.signtype);
				// console.log(this.communicationtype);
			},
			handleClose() {
				this.remarkvalue = ''
				this.showremark = false
				this.refundshowDialog = false
				this.contentshow = true
			},

			//提交备注
			subremark() {
				if (this.remarkvalue == '') {
					return this.$message.warning('请输入备注再提交')
				}
				let params = {
					applicationid: this.addmarkdata.applicationid,
					remark: this.remarkvalue,
				}
				this.$ceshiAxios.post('/v1/shop/updateApplication', params).then(res => {
					if (res.data.code == 1) {
						this.$message.success('操作成功')
						this.showremark = false
						if (this.returntypes) {
							this.getRefundList()
						} else {
							this.getStoreApply()
						}



					} else {
						this.$message.warning(res.data.message)
					}
				})
			},

			//报名人员的状态判断
			//无意愿
			unpassed(data) {
				console.log(data);
				if (data.status == '无意愿') {
					return
				}
				let params = {
					applicationid: data.applicationid,
					userid: data.userid,
					status: 3,
				}
				this.$ceshiAxios.post('/v1/shop/updateApplication', params).then(res => {
					console.log(res);
					if (res.data.code == 1) {
						this.$message.success('操作成功')
					} else {
						this.$message.warning(res.data.message)
					}
				})
				this.getStoreApply()
			},
			//录取
			passed(data) {
				console.log(data);
				if (data.status == '无意愿') {
					return
				}
				let params = {
					applicationid: data.applicationid,
					userid: data.userid,
					status: 2,
				}
				this.$ceshiAxios.post('/v1/shop/updateApplication', params).then(res => {
					if (res.data.code == 1) {
						this.$message.success('操作成功')
					} else {
						this.$message.warning(res.data.message)
					}
				})
				this.getStoreApply()
			},
			//未录取
			unpass(data) {
				console.log(data);
				if (data.status == '无意愿') {
					return
				}
				let params = {
					applicationid: data.applicationid,
					userid: data.userid,
					status: 4,
				}
				this.$ceshiAxios.post('/v1/shop/updateApplication', params).then(res => {
					if (res.data.code == 1) {
						this.$message.success('操作成功')
					} else {
						this.$message.warning(res.data.message)
					}
				})
				this.getStoreApply()
			},
			// watch: {
			// 	passname:function(val) {
			// 	    this.passname = val;
			// 	},
			// },
			//岗位名称传值
			changeName(name) {
				console.log(name);
				this.signsearchName = name
			},
			//打开岗位选择岗位名称弹框
			openPositioname() {
				this.postMsgByname.showDialog = true;
				console.log('打开');
			},
			//刷新
			reset() {
				let params = {}
				this.$storesAxios.post('/v1/shop/refreshList', params).then(res => {
					console.log(res);
					if (res.data.code == 1) {
						this.$message.success('刷新成功');
					} else {
						this.$message.warning('刷新失败');
					}
				})

				console.log('刷新一下');
			},
			/* 头部主tabs栏切换 */
			mainTabSwitch(index) {
				this.mainTabs.index = index;
				this.headerTitle = this.mainTabs.data[index].title;
				this.searchData.showComponent = true;
				this.navList.data = [];
				if (index == 0) {
					this.searchData.noCompanyName = false;
					this.searchData.noSubordinate = false;
					this.searchData.noPost = false;
					this.tableList.list = [{
							title: '门店名称',
							prop: 'shopName',
							isClick: false
						},
						{
							title: '创建者姓名',
							prop: 'createusername',
							isClick: false
						},
						{
							title: '注册时间',
							prop: 'insertdate',
							isClick: false
						},
					]
				} else if (index == 1) {
					this.searchData.showComponent = false;
					this.navList.data = [{
							title: '待审核'
						},
						{
							title: '已通过'
						},
						{
							title: '未通过'
						}
					];
					this.tableList.list = [{
							title: '门店名称',
							prop: 'shopName',
							isClick: false
						},
						{
							title: '创建者姓名',
							prop: 'createusername',
							isClick: false
						},
						{
							title: '提交时间',
							prop: 'insertdate',
							isClick: false
						},
					]
				} else if (index == 2) {
					//返费查询
					// this.searchData.noShopName= false, //门店名称
					// this.searchData.noFounder=false, //创建者姓名
					// this.searchData.noTime=false, //时间段
					this.searchData.noSubordinate = false;
					this.searchData.noPost = false;
					this.navList.data = [{
							title: '专项岗位入职信息'
						},
						{
							title: '专项岗位入职奖励'
						},
						{
							title: '专项岗位招聘奖励'
						}
					];
				} else if (index == 3) {
					this.searchData.showComponent = false;
					this.navList.data = [{
							title: '发布中'
						},
						{
							title: '已下架'
						},
					];
				} else if (index == 4) {
					this.searchData.showComponent = false;
					this.navList.data = [{
							title: '待审核'
						},
						{
							title: '已通过'
						},
						{
							title: '未通过'
						},
					];
				} else if (index == 5) {
					this.searchData.showComponent = false;
				}

				this.tabSwitch(0);
			},

			/* 子tabs栏切换 */
			tabSwitch(index) {
				this.navList.index = index;
				this.tableList.noOperation = true;
				if (this.mainTabs.index == 0) {
					this.tableList.noOperation = false;
				} else if (this.mainTabs.index == 1) {
					if (index == 0) {
						this.tableList.operation = [{
							name: '审核',
							isBtn: false,
							title: 'openExamineDialog'
						}]
					} else {
						this.tableList.operation = [{
								name: '查看',
								isBtn: false,
								title: 'openLookDialog'
							},
							{
								name: '编辑',
								isBtn: false,
								title: 'editLookDialog'
							} //编辑按钮
						]
					}
				} else if (this.mainTabs.index == 2) {
					if (index == 0) {
						//返费信息
						this.index3 = ""
						this.tableList.list = [{
								title: '门店名称',
								prop: 'shopName',
								isClick: true,
								eventName: 'openreturn'

							},
							{
								title: '门店创建者名称',
								prop: 'shopusername',
								isClick: false
							},
							{
								title: '入职人员姓名',
								prop: 'username',
								isClick: false
							},
							{
								title: '岗位名称',
								prop: 'positionname',
								isClick: true,
								eventName: 'position'
							},
							{
								title: '入职时间',
								prop: 'updatedate',
								isClick: false
							},
						]
						this.tableList.operation = [{
								name: '发放奖励',
								isBtn: false,
								title: 'openRefundDialog'
							},
							{
								name: '添加备注',
								isBtn: false,
								title: 'addremarks'
							},
							{
								name: '置顶',
								isBtn: false,
								title: 'totop'
							},
							{
								name: '取消置顶',
								isBtn: false,
								title: 'totop'
							},
						]
					} else if (index == 1) {
						//返费信息
						this.index3 = 1
						this.tableList.list = [{
								title: '门店名称',
								prop: 'shopName',
								isClick: true,
								eventName: 'openreturn'

							},
							{
								title: '门店创建者名称',
								prop: 'shopusername',
								isClick: false
							},
							{
								title: '入职人员姓名',
								prop: 'username',
								isClick: false
							},
							{
								title: '岗位名称',
								prop: 'positionname',
								isClick: true,
								eventName: 'position'
							},
							{
								title: '入职时间',
								prop: 'updatedate',
								isClick: false
							},
							{
								title: '入职奖励金额',
								prop: 'interalnum',
								isClick: false
							},
							{
								title: '奖励时间',
								prop: 'insertdate',
								isClick: false
							},
						]
						this.tableList.noOperation = false
					} else {
						//返费信息
						this.index3 = 2
						this.tableList.list = [{
								title: '门店名称',
								prop: 'shopName',
								isClick: true,
								eventName: 'openreturn'
							},
							{
								title: '门店创建者名称',
								prop: 'shopusername',
								isClick: false
							},
							{
								title: '入职人员姓名',
								prop: 'username',
								isClick: false
							},
							{
								title: '岗位名称',
								prop: 'positionname',
								isClick: true,
								eventName: 'position'
							},
							{
								title: '入职时间',
								prop: 'insertdate',
								isClick: false
							},
							{
								title: '招聘奖励金额',
								prop: 'interalnum',
								isClick: false
							},
							{
								title: '奖励时间',
								prop: 'insertdate',
								isClick: false
							},
						]
						this.tableList.noOperation = false
					}
				} else if (this.mainTabs.index == 3) {
					if (index == 0) {
						this.tableList.list = [{
								title: '企业名称',
								prop: 'companyname',
								isClick: false
							},
							{
								title: '岗位名称',
								prop: 'positionname',
								isClick: false
							},
							{
								title: '薪资',
								prop: 'salary',
								isClick: false
							},
							{
								title: '奖励标准',
								prop: 'rewardStandard',
								isClick: false
							},
							{
								title: '发放备注',
								prop: 'returnTime',
								isClick: false
							},
							{
								title: '上架时间',
								prop: 'insertdate',
								isClick: false
							},
						]
						this.tableList.operation = [{
								name: '下架',
								isBtn: false,
								title: 'offTheShelf'
							},
							{
								name: '修改',
								isBtn: false,
								title: 'updateTheShelf'
							},

						]
					} else {
						this.tableList.list = [{
								title: '企业名称',
								prop: 'companyname',
								isClick: false
							},
							{
								title: '岗位名称',
								prop: 'positionname',
								isClick: false
							},
							{
								title: '薪资',
								prop: 'salary',
								isClick: false
							},
							{
								title: '奖励标准',
								prop: 'rewardStandard',
								isClick: false
							},
							{
								title: '返费发放时间',
								prop: 'returnTime',
								isClick: false
							},
							{
								title: '上架时间',
								prop: 'insertdate',
								isClick: false
							},
							{
								title: '下架时间',
								prop: 'outdate',
								isClick: false
							},
						]
						this.tableList.operation = [{
							name: '重新上架',
							isBtn: false,
							title: 'reshelf'
						}]
					}
				} else if (this.mainTabs.index == 4) {
					this.tableList.data = [];
					this.tableList.list = [{
							title: '企业名称',
							prop: 'shopName',
							isClick: false
						},
						{
							title: '代招企业名称',
							prop: 'replaceCompanyname',
							isClick: false
						},
						{
							title: '职位名称',
							prop: 'positionname',
							isClick: true,
							eventName: 'position'
						},
						{
							title: '工作地点',
							prop: 'address',
							isClick: false
						},
						{
							title: '薪资待遇',
							prop: 'salary',
							isClick: false
						},
						{
							title: '招聘人数',
							prop: 'recruitment',
							isClick: false
						},
					]
					if (index == 0) {
						//切换数据
						this.tableList.operation = [{
								name: '审核',
								isBtn: false,
								title: 'examinePosit'
							},
							{
								name: '下架',
								isBtn: false,
								title: 'postOffShelves'
							},
						]
					} else if (index == 1) {
						this.tableList.operation = [{
							name: '下架',
							isBtn: false,
							title: 'postOffShelves'
						}, ]
					} else {
						this.tableList.operation = [{
							name: '查看',
							isBtn: false,
							title: 'postView'
						}, ]
					}
				} else if (this.mainTabs.index == 5) {
					// this.tableList.noOperation = false;
					this.tableList.data = [];
					this.tableList.list = [{
							title: '报名人员',
							prop: 'username',
							isClick: true,
							eventName: 'getsignname'
						},
						{
							title: '手机号码',
							prop: 'telnum',
							isClick: false
						},
						{
							title: '报名时间',
							prop: 'insertdate',
							isClick: false,
						},
						{
							title: '专享岗位',
							prop: 'positionname',
							isClick: false
						},
						{
							title: '门店名称',
							prop: 'shopName',
							isClick: true,
							eventName: 'getshopinfo'
						},
						{
							title: '状态',
							prop: 'status',
							isClick: false
						},
						{
							title: '备注',
							prop: 'remarks',
							isClick: true,
							eventName: 'addremark'
						},
						// {
						// 	title: '操作1',
						// 	prop: 'status',
						// 	isClick: true
						// },
						// {
						// 	title: '操作1',
						// 	prop: 'status',
						// 	isClick: true
						// },
						// {
						// 	title: '操作1',
						// 	prop: 'status',
						// 	isClick: true
						// },
					]
					if (index == 0) {
						//切换数据
						this.tableList.operation = [{
								name: '录取',
								isBtn: false,
								title: 'passed'
							},
							{
								name: '未录取',
								isBtn: false,
								title: 'unpassed'
							},
							{
								name: '无意愿',
								isBtn: false,
								title: 'unpass'
							},
						]
					}
				}
				this.getDataList(this.searchData.searchInfo);
			},
			// 获取数据列表整合
			getDataList(data) {
				this.tableList.data = [];
				if (this.mainTabs.index == 0) {
					this.getStoreList(data);
				} else if (this.mainTabs.index == 1) {
					this.getStoreExamineList();
				} else if (this.mainTabs.index == 2) {
					this.getRefundList(data);
				} else if (this.mainTabs.index == 3) {
					this.getPayList();
				} else if (this.mainTabs.index == 4) {
					this.getStoreRecruitmentList();
				} else if (this.mainTabs.index == 5) {
					this.getStoreApply();
				}
			},
			// 获取门店数据列表
			getStoreList(data) {
				let params = {
					pageSize: this.pageSize,
					pageNum: this.cur
				}
				if (data) {
					if (data.shopName) {
						params.shopName = data.shopName;
					}
					if (data.createusername) {
						params.createusername = data.createusername;
					}
					if (data.startDate) {
						params.registerStartDate = data.startDate;
					}
					if (data.endDate) {
						params.registerEndDate = data.endDate;
					}
				}
				this.$storesAxios.post('/v1/shop/selectAllShopMeasagePC', params).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						let result = res.data.data;
						this.totalNum = parseInt(result.totalnum);
						this.tableList.data = result.appShopBesemessages;
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},
			// 获取门店信息审核列表数据
			getStoreExamineList() {
				let params = {
					pageSize: this.pageSize,
					pageNum: this.cur,
					type: this.navList.index
				}
				if (params.type == 1) {
					this.tableList.list = [{
							title: '门店编号',
							prop: 'storesNumber',
							isClick: false
						},
						{
							title: '门店名称',
							prop: 'shopName',
							isClick: false
						},
						{
							title: '创建者姓名',
							prop: 'createusername',
							isClick: false
						},
						{
							title: '注册时间',
							prop: 'insertdate',
							isClick: false
						},
					]
				} else {
					this.tableList.list = [{
							title: '门店名称',
							prop: 'shopName',
							isClick: false
						},
						{
							title: '创建者姓名',
							prop: 'createusername',
							isClick: false
						},
						{
							title: '注册时间',
							prop: 'insertdate',
							isClick: false
						},
					]
				}

				console.log(params, 'params');
				this.$storesAxios.post('/v1/shop/selectAppShopMessageByAudit', params).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						let result = res.data.data;
						this.totalNum = parseInt(result.totalnum);
						this.tableList.data = result.appShopBesemessages;
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},
			// 获取返费信息列表
			getRefundList(data) {
				let params = {
					searchName: this.searchData.keyval,
					operation: this.index3,
					pageSize: this.pageSize,
					pageNum: this.cur,
				}
				let url = '/v1/shop/returncost';
				if (data) {
					if (data.shopName) {
						params.shopName = data.shopName;
					}
					if (data.companyName) {
						params.companyname = data.companyName;
					}
					if (data.createusername) {
						params.createusername = data.createusername;
					}
					if (data.post) {
						params.positionname = data.post;
					}
					if (data.startDate) {
						params.entryStartDate = data.startDate;
					}
					if (data.endDate) {
						params.entryEndDate = data.endDate;
					}
				}
				if (this.mainTabs.index == 2 && this.navList.index == 1) {
					url = '/v1/shop/returncostPosition'
				} else if (this.mainTabs.index == 2 && this.navList.index == 2) {
					url = '/v1/shop/returncostPosition'
				}

				this.$ceshiGetAxios(url, params).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						this.tableList.data = res.data.data.list;
						this.totalNum = parseInt(res.data.data.total);
					} else {
						this.$message.warning(res.data.message);
					}
				})
				//返费数据


			},
			// 获取公告岗位管理列表数据
			getPayList() {
				let params = {
					searchName: this.searchName,
					pageSize: this.pageSize,
					pageNum: this.cur,
					type: this.navList.index == 0 ? 1 : 0
				}
				this.$storesAxios.post('/v1/shop/selectAnnouncementPositionList', params).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						let result = res.data.data;
						this.totalNum = parseInt(result.totalnum);
						result.shopPositionReturncostVos.forEach(item => {
							item.salary = item.miniwage + '-' + item.maxwage;
							item.refundStandard = '员工自入职' + item.cost + '元/' + (item.returnType == 1 ?
								'小时' : '月') + "\n" + '门店送入职奖励' + item.manageCost + '元/' + (item
								.manageReturnType == 1 ? '小时' : '月');
						})
						this.tableList.data = result.shopPositionReturncostVos;
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},

			//报名人员
			getStoreApply() {
				console.log(this.mainTabs.index, 'this.mainTabs.index');
				// this.changeName(); this.signtypethis.communicationtype
				let params = {
					status: this.signtype,
					communicationType: this.communicationtype,
					positionname: this.storshopname,
					searchName: this.searchName1,
					pagesize: this.pageSize,
					pageNum: this.cur,
					tabstype: this.navList.index + 5
				}
				console.log(params.tabstype, 'tabstype');
				this.$ceshiAxios.post('/v1/shop/shopapplication', params).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						let result = res.data.data;
						this.tableList.data = result.list;

						for (var i in this.tableList.data) {
							// if(this.tableList.data[i].status==="无意愿"){

							// } 
							if (this.tableList.data[i].remark != undefined) {
								if (this.tableList.data[i].remark.length > 10) {
									this.tableList.data[i].remarks = this.tableList.data[i].remark.substring(0,
										10) + '...';
								} else {
									this.tableList.data[i].remarks = this.tableList.data[i].remark;
								}
							} else {
								this.tableList.data[i].remarks = "添加备注"
							}

							//报名人员操作栏的控制看封装的表格组件这里是为了判断报名人员操作而处理的 comtable 组件
							if (this.tableList.data[i].status == '录取') {
								this.tableList.data[i].statuss = '录取'
							} else if (this.tableList.data[i].status == '未录取') {
								this.tableList.data[i].statuss = '未录取'
							} else if (this.tableList.data[i].status == '无意愿') {
								this.tableList.data[i].statuss = '未录取'
							} else if (this.tableList.data[i].status == '待办') {
								this.tableList.data[i].statuss == '待办'
							}


							if (this.tableList.data[i].status == '待办' && this.tableList.data[i]
								.communicationType == 1) {
								this.tableList.data[i].status = '待办 / 待沟通'
							} else if (this.tableList.data[i].status == '待办' && this.tableList.data[i]
								.communicationType == 2) {
								this.tableList.data[i].status = '待办 / 未回复'
							} else if (this.tableList.data[i].status == '待办' && this.tableList.data[i]
								.communicationType == 3) {
								this.tableList.data[i].status = '待办 / 回复同意'
							} else if (this.tableList.data[i].status == '待办' && this.tableList.data[i]
								.communicationType == 4) {
								this.tableList.data[i].status = '待办 / 回复拒绝'
							} else if (this.tableList.data[i].status == '录取' && this.tableList.data[i]
								.communicationType == 1) {
								this.tableList.data[i].status = '录取 / 工作中'
							} else if (this.tableList.data[i].status == '录取' && this.tableList.data[i]
								.communicationType == 2) {
								this.tableList.data[i].status = '录取 / 保障期待确认'
							} else if (this.tableList.data[i].status == '录取' && this.tableList.data[i]
								.communicationType == 3) {
								this.tableList.data[i].status = '录取 / 保障期确认完成'
							} else if (this.tableList.data[i].status == '录取' && this.tableList.data[i]
								.communicationType == 4) {
								this.tableList.data[i].status = '录取 / 线下门店发起离职'
							} else if (this.tableList.data[i].status == '录取' && this.tableList.data[i]
								.communicationType == 5) {
								this.tableList.data[i].status = '录取 / 报名人员确认离职'
							}


						}
						this.totalNum = parseInt(result.total);
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},
			/* 门店招聘岗位列表 */
			getStoreRecruitmentList() {
				console.log(this.mainTabs.index, 'this.mainTabs.index');
				let params = {
					searchName: this.searchName1,
					pagesize: this.pageSize,
					pagenum: this.cur,
					tabstype: this.navList.index + 5
				}
				console.log(params.tabstype, 'tabstype');
				this.$storesAxios.post('v1/platform/company/positionlist', params).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						let result = res.data.data;
						result.list.forEach((item, index) => {
							item.salary = item.miniwage + '-' + item.maxwage;
						})
						this.tableList.data = result.list;
						this.totalNum = parseInt(result.totalnum);
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},
			/* 门店招聘岗位-职位信息 */
			positionDetails(data) {
				console.log(data);
				this.positionMsg.userInfo = data;
				this.$axios.post('/app/v1/recruit/stationInfo', {
					positionid: data.positionid
				}).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						let result = res.data.data;
						result.welfareList = result.welfarename.split(';');
						if (!result.miniwage && result.maxwage) {
							result.offer = `${parseInt(result.maxwage) / 1000}K以下`;
						} else if (!result.maxwage && result.miniwage) {
							result.offer = `${parseInt(result.miniwage) / 1000}K以上`;
						} else {
							result.offer =
								`${parseInt(result.miniwage) / 1000}-${parseInt(result.maxwage ) / 1000}K`;
						}

						this.positionMsg.userInfo = result;
						this.positionMsg.company = data.shopName;
						this.positionMsg.showDialog = true;
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},

			//打开门店信息
			getshopinfo() {

			},

			//打开简历弹框
			getsignname(row, rows) {
				console.log(rows)
				this.userid = rows.userid;
				this.nickName = rows.username;
				this.dialogVisible = true;
			},
			/* 门店招聘岗位-审核岗位 */
			examinePosit(data) {
				console.log(data);
				this.$confirm('是否确定审核？', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$axios.post('/app/v1/platform/company/positionAuditCommit', {
						"positionid": data.positionid
					}).then(res => {
						console.log(res);
						if (res.data.code === 1) {
							this.getDataList(this.searchData.searchInfo);
							this.$message({
								type: 'success',
								message: '审核成功!'
							});
						} else {
							this.$message.warning(res.data.message);
						}
					})
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取审核'
					});
				});
			},

			/* 门店招聘岗位- 岗位下架*/
			postOffShelves(data) {
				console.log(data + '看看数据');
				this.putDownPosition.userInfo = data;
				this.putDownPosition.showDialog = true;
			},
			/* 门店招聘岗位-审核结果查看 */
			postView(data) {
				console.log(data);
				let params = {
					orderid: data.positionid,
					pagenum: 1,
					type: "4"
				};
				this.$axios.post('/app/v1/platform/unusual/operateLogList', params).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						this.putDownRecordMsg.tableData = res.data.data.list;
					} else {
						this.$message.warning(res.data.message);
					}
				})
				this.putDownRecordMsg.showDialog = true;

			},
			/* 门店招聘岗位-提交下架理由 */
			subPutDown(text) {
				console.log(text);
				let params = {
					restoreintegral: 0,
					restoremoney: 0,
					positionid: this.putDownPosition.userInfo.positionid,
					remark: text
				}
				this.$axios.post('/app/v1/platform/company/cancelposition', params).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						this.getDataList(this.searchData.searchInfo);
						this.putDownPosition.showDialog = false;
						this.$refs.postReason.clearData();
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},
			//按搜索条件搜索数据
			searchList(form) {
				console.log(form);
				this.searchData.searchInfo = form;
				this.getDataList(form);
			},

			addremark(data, type) {
				this.addmarkdata = data
				if (data.remark != undefined) {
					this.remarkvalue = data.remark
				}
				this.showremark = true
				if (type == 'return') {
					this.returntypes = true
				}
				console.log(data);
			},
			//打开审核弹窗
			openExamineDialog(type, data) {
				console.log(type);
				console.log(data);
				this.storeMsg.type = type;
				let userids = data.userid
				if (type == 'lookshop') {
					userids = data.shopuserid
					console.log('lookshop');
				} else if (type == 'lookreturnshop') {
					userids = data.shopuserid
				}
				// 请求弹窗数据
				this.$storesAxios.post('/v1/shop/selectShopMeaasgePC', {
					userid: userids
				}).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						let result = res.data.data;
						this.storeMsg.msg = result.appShopBesemessage;
						result.appShopAuditRecords.forEach(item => {
							if (item.status == 1) {
								item.cause = '成功了';
							}
						})
						this.storeMsg.dataList = result.appShopAuditRecords;
						this.storeMsg.showDialog = true;
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},

			//编辑审核弹窗
			ediExamineDialog(type, data) {
				console.log(type);
				console.log(data);
				this.fileLists = []
				this.fileLists[0] = {
					url: data.shopShowPhoto
				}
				this.storeMsg.type = type;

				console.log('222222', data.shopShowPhoto);
				// 请求弹窗数据
				this.$storesAxios.post('/v1/shop/selectShopMeaasgePC', {
					userid: data.userid
				}).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						let result = res.data.data;
						this.storeMsg.msg = result.appShopBesemessage;
						result.appShopAuditRecords.forEach(item => {
							if (item.status == 1) {
								item.cause = '成功了';
							}
						})


						this.storeMsg.dataList = result.appShopAuditRecords;

						this.storeMsg.showEditDialog = true;
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},

			//提交审核门店信息
			examineStoreFn(data) {
				let params = {
					userid: this.storeMsg.msg.userid,
					userName: JSON.parse(localStorage.getItem('userinfo')).username,
					shopid: this.storeMsg.msg.shopid,
				}
				if (data) {
					params.status = 2;
					params.cause = data;
					this.$storesAxios.post('/v1/shop/auditShop', params).then(res => {
						console.log(res);
						if (res.data.code === 1) {
							this.$message({
								message: '操作成功！',
								type: 'success'
							})
							this.storeMsg.showDialog = false;
							this.getDataList(this.searchData.searchInfo);
						} else {
							this.$message.warning(res.data.message);
						}
					})
				} else {
					this.passExamine.userInfo = this.storeMsg.msg;
					this.storeMsg.showDialog = false;
					this.passExamine.showDialog = true;
				}

			},
			//通过门店审核
			passStore(form) {
				let city = require('../../assets/city.json')
				this.optionss = city.city
				for (var i in this.optionss) {
					for (var k in this.optionss[i].children) {
						for (var z in this.optionss[i].children[k].children) {
							if (this.storeMsg.msg.area == this.optionss[i].children[k].children[
									z].label) {
								this.storeMsg.msg.area = this.optionss[i].children[k].children[z].value
								console.log(this.storeMsg.msg.area, '区域');
							}
						}

					}
				}

				let data = {
					userid: this.storeMsg.msg.userid,
					userName: JSON.parse(localStorage.getItem('userinfo')).username,
					shopid: this.storeMsg.msg.shopid,
					status: 1,
					area: this.storeMsg.msg.area,
				}
				console.log(this.storeMsg.msg, '门店信息');
				this.$storesAxios.post('/v1/shop/auditShop', data).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						let params = {
							shopid: this.storeMsg.msg.shopid,
						}
						Object.assign(params, form);
						console.log(params);
						this.$storesAxios.post('/v1/shop/updateShopMsgBypc', params).then(json => {
							console.log(json);
							if (json.data.code === 1) {
								this.$message({
									message: '操作成功！',
									type: 'success'
								})
								this.passExamine.showDialog = false;
								this.getDataList(this.searchData.searchInfo);
							} else {
								this.$message.warning(json.data.message);
							}
						})
					}
				})
			},
			//关闭发布岗位弹窗
			closePostDialogn() {
				this.postMsg.showDialog = false;
				this.getDataList(this.searchData.searchInfo);
			},
			//打开已发放返费弹框
			openRefundDialog(data) {
				console.log(data);
				this.redata = data
				this.appliocationid = data.applicationid;
				this.diauserid = data.userid;
				console.log(data);
				this.refund.data = data;
				this.refundshowDialog = true;
			},
			//打开方法返费弹窗
			openPayDialog(data) {
				console.log(data);
				this.refundshowDialog = true
				// this.pay.showDialog = true;
				this.pay.data = data;
			},
			//提交发放返费弹窗数据
			subPayData(data) {
				console.log(data);
				let params = {
					operator: JSON.parse(localStorage.getItem('userinfo')).username,
					companyid: this.pay.data.companyid,
					employeeid: this.pay.data.employeeid,
					positionid: this.pay.data.positionid,
					employeeuserid: this.pay.data.employeeuserid,
					hruserid: this.pay.data.hruserid,
					shopid: this.pay.data.shopid,
					manageShopUserid: this.pay.data.manageShopUserid,
					manageShopid: this.pay.data.manageShopid,
					userid: this.pay.data.userid,
					type: this.pay.data.type
				}
				Object.assign(params, data);
				this.$storesAxios.post('/v1/shop/insertAppShopAward', params).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						this.$message({
							message: '操作成功！',
							type: 'success'
						})
						this.pay.showDialog = false;
						this.getDataList(this.searchData.searchInfo);
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},
			//提交下架数据
			offTheShelf(data) {
				console.log(data);
				this.$confirm('是否确定下架该公告岗位？', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					let params = {
						delete: 0,
						ids: [data.id],
					}
					this.$storesAxios.post('/v1/shop/updateAnnouncementPosition', params).then(res => {
						console.log(res);
						if (res.data.code === 1) {
							this.$message({
								type: 'success',
								message: '下架成功!'
							});
							this.getDataList(this.searchData.searchInfo);
						} else {
							this.$message.warning(res.data.message);
						}
					})


				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消下架操作'
					});
				});
			},
			//打开添加岗位弹窗
			openAddPositionDialog(type, data) {
				console.log(type);
				console.log(data);
				if (data) {
					this.postMsg.userInfo = data;
				}
				console.log(this.postMsg.userInfo + 'userinfo');
				this.postMsg.type = type;
				this.postMsg.showDialog = true;

			},
			//接收导入的数据结果
			openImportResult(list) {
				this.leadMsg.showDialog = false;
				this.importData.dataList = list;
				this.importData.showDialog = true;
			},
			//提交导入数据
			subImportData() {
				this.$storesAxios.post('/v1/shop/batchToLeadExcel', {
					returnCostListBean: this.importData.dataList
				}).then(res => {
					console.log(res);
					if (res.data.code === 1) {
						this.$message({
							message: '导入成功！',
							type: 'success'
						})
						this.importData.showDialog = false;
						this.getDataList(this.searchData.searchInfo);
					} else {
						this.$message.warning(res.data.message);
					}
				})
			},

			//当前页是第几页,点击的第几页的时候调用这个函数	
			pageChange(p) {
				// 点击的时候传过来一个参数，这个参数就是所点击的当前页数，
				// 然后把这个当前页数转换成字符串形式赋值给page，
				// 然后把page这个参数传给search这个方法
				console.log(p);
				this.cur = p;
				this.getDataList(this.searchData.searchInfo);
			},
			//每页有多少条,10,20,50等,点击选择的时候调用这个方法
			handleSizeChange(val) {
				console.log(val);
				this.pageSize = val;
				this.getDataList(this.searchData.searchInfo);
			},
		}
	}
</script>

<style scoped="scoped">
	.remark {
		width: 400px;
		height: 250px;
		margin: 0 auto;
	}

	.remark>.el-button {
		width: 160px;
		margin: 20px 122px;
		border-radius: 20px;
	}

	.remark>h3 {
		margin: 0 auto;
		width: 67px;
		font-size: 21px;
		padding: 13px 6px;
		font-weight: 600;
	}


	.container {
		background-color: #fff;
		height: 100%;
		padding-left: 20px;
	}

	.main-tabs {
		background-color: #EFF1F8;
		margin-bottom: 20px;
		margin-left: -20px;
		padding-left: 50px;
	}

	.main-tabs li {
		height: 40px;
		line-height: 40px;
		float: left;
		margin: 10px 20px;
		padding: 0 30px;
		cursor: pointer;
	}

	.main-tabs .active {
		background: #0064E4;
		border-radius: 20px;
		color: #fff;
	}

	.header-title {
		padding: 0 0 20px 0;
		border-bottom: 1px solid #D2D2D2;
		margin-bottom: 20px;
	}

	.header-title .border {
		width: 15px;
		height: 30px;
		background-color: #0064E4;
		margin-right: 20px;
		float: left;
	}

	.header-title p {
		float: left;
		font-weight: bold;
		line-height: 30px;
	}

	.header-title .opt span {
		float: left;
		margin-right: 20px;
		padding: 10px 20px;
		border: 1px solid #000;
		border-radius: 6px;
		cursor: pointer;
	}

	.pageBox {
		margin-top: 20px;
	}

	.box_entry {
		padding: 20px;
		width: 400px;
		margin: 0 auto;
	}

	.box_entry h2 {
		text-align: center;
		font-weight: bold;
		font-size: 18px;
	}

	.box_entry>.item {
		margin-top: 20px;
		padding: 18px 15px;
		border: 1px solid rgb(203, 203, 205);
		border-radius: 4px;
		font-size: 16px;
		font-weight: 800;
		text-align: center;
		cursor: pointer;
	}

	.box_content {
		width: 480px;
		padding: 0 10px;
		margin: 0 auto;

	}

	.box_content h2 {
		align-items: center;
		font-weight: bold;
		font-size: 18px;
		padding-top: 23px;
		margin-bottom: 20px;
		padding-left: 35px;
	}


	.subtn {
		display: inline-block;
		margin-top: 20px;
		margin-left: 108px;
		border-radius: 20px;
		padding: 12px 64px;
		margin-bottom: 10px;
		background-color: rgb(74, 36, 242);
		margin-bottom: 23px;
	}

	.getcode {
		display: inline-block;
		border: 1px solid rgb(220, 223, 230);
		margin-left: 56px;
		font-size: 13px;
		padding: 0px 8px;
		border-radius: 20px;
		cursor: pointer;
	}

	/deep/ .el-form-item__label {
		line-height: 34px;
		font-size: 16px;
	}
</style>
